//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#ifndef __CCONSTRUCTORINFO_H__
#define __CCONSTRUCTORINFO_H__

#include "CMethodInfo.h"

class CConstructorInfo : public IConstructorInfo
{
public:
    CARAPI_(PInterface) Probe(REIID riid);
    CARAPI_(UInt32) AddRef();
    CARAPI_(UInt32) Release();
    CARAPI Aggregate(AggregateType type, PInterface pObj);
    CARAPI GetDomain(PInterface *ppObj);

    CARAPI GetName(
        /* [out] */ AStringBuf * pName);

    CARAPI GetParamCount(
        /* [out] */ Int32 * pCount);

    CARAPI GetAllParamInfos(
        /* [out] */ BufferOf<IParamInfo *> * pParamInfos);

    CARAPI GetParamInfoByIndex(
        /* [in] */ Int32 index,
        /* [out] */ IParamInfo ** ppParamInfo);

    CARAPI GetParamInfoByName(
        /* [in] */ AString name,
        /* [out] */ IParamInfo ** ppParamInfo);

    CARAPI CreateArgumentList(
        /* [out] */ IArgumentList ** ppArgumentList);

    CARAPI CreateObject(
        /* [in] */ IArgumentList * pArgumentList,
        /* [out] */ PInterface * pObject);

    CARAPI CreateObjectInContext(
        /* [in] */ PContext ctx,
        /* [in] */ IArgumentList * pArgumentList,
        /* [out] */ PInterface * pObject);

    CARAPI AcquireParamList();

    CARAPI CreateObjInCtx(
        /* [in] */ PContext ctx,
        /* [in] */ IArgumentList * pArgumentList,
        /* [out] */ PInterface * pObject);

    CConstructorInfo(){}

    CARAPI Init(
        /* [in] */ CClsModule * pCClsModule,
        /* [in] */ MethodDescriptor *pMethodDescriptor,
        /* [in] */ UInt32 uIndex,
        /* [in] */ ClassID *pClsId);

    virtual ~CConstructorInfo();

    CMethodInfo    *m_pMethodInfo;

private:
    Int32           m_nOutParamIndex;

    wchar_t m_wszUrn[_MAX_PATH];
    ClassID m_clsId;

    Interlocked m_cRef;
};

#endif // __CCONSTRUCTORINFO_H__
